package ecom.entity;


import java.util.ArrayList;
import java.util.Collection;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;

/***
 * 
 * @author Alexandra NITU
 *
 */



@Entity
public class OptionPayante {

	private long id;
	private String nom;
	private String description;
	private float prix;
	private int dureedevie;// nombre de jours de validite d'option

	public int getDureedevie() {
		return dureedevie;
	}
	public void setDureedevie(int dureedevie) {
		this.dureedevie = dureedevie;
	}

	private Collection<OptionAchetee> optionAcheteeCollection;
	
	@OneToMany(mappedBy = "optionPayante")
	public Collection<OptionAchetee> getOptionAcheteeCollection() {
		return optionAcheteeCollection;
	}
	public void setOptionAcheteeCollection(
			Collection<OptionAchetee> optionAcheteeCollection) {
		this.optionAcheteeCollection = optionAcheteeCollection;
	}
	public OptionPayante(long id, String nom, String description, float prix,
			Collection<OptionAchetee> optionAcheteeCollection) {
		super();
		this.id = id;
		this.nom = nom;
		this.description = description;
		this.prix = prix;
		this.optionAcheteeCollection = optionAcheteeCollection;
	}
	public OptionPayante(long id, String nom, String description, float prix,
			int dureedevie, Collection<OptionAchetee> optionAcheteeCollection) {
		super();
		this.id = id;
		this.nom = nom;
		this.description = description;
		this.prix = prix;
		this.dureedevie = dureedevie;
		this.optionAcheteeCollection = optionAcheteeCollection;
	}
	public OptionPayante(String nom, String description, float prix) {
		super();
		this.nom = nom;
		this.description = description;
		this.prix = prix;
	}
	public OptionPayante()
	{
		optionAcheteeCollection = new ArrayList<OptionAchetee>();
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public float getPrix() {
		return prix;
	}

	public void setPrix(float prix) {
		this.prix = prix;
	}

	
	
	
//	public Collection<OptionAchetee> getOptionAcheteeCollection() {
//		return optionAcheteeCollection;
//	}
//
//	public void setOptionAcheteeCollection(
//			Collection<OptionAchetee> optionAcheteeCollection) {
//		this.optionAcheteeCollection = optionAcheteeCollection;
//	}

}
